package com.zhengshang.api.service.impl;

import java.util.List;
import com.zhengshang.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhengshang.api.mapper.AppVideoDramaMapper;
import com.zhengshang.api.domain.AppVideoDrama;
import com.zhengshang.api.service.IAppVideoDramaService;

/**
 * 电视剧剧集Service业务层处理
 * 
 * @author zhengshang
 * @date 2021-05-17
 */
@Service
public class AppVideoDramaServiceImpl implements IAppVideoDramaService 
{
    @Autowired
    private AppVideoDramaMapper appVideoDramaMapper;

    /**
     * 查询电视剧剧集
     * 
     * @param id 电视剧剧集ID
     * @return 电视剧剧集
     */
    @Override
    public AppVideoDrama selectAppVideoDramaById(Long id)
    {
        return appVideoDramaMapper.selectAppVideoDramaById(id);
    }

    /**
     * 查询电视剧剧集列表
     * 
     * @param appVideoDrama 电视剧剧集
     * @return 电视剧剧集
     */
    @Override
    public List<AppVideoDrama> selectAppVideoDramaList(AppVideoDrama appVideoDrama)
    {
        return appVideoDramaMapper.selectAppVideoDramaList(appVideoDrama);
    }

    @Override
    public List<AppVideoDrama> queryAppVideoDramaListByVideoId(Long videoId) {
        return appVideoDramaMapper.queryAppVideoDramaListByVideoId(videoId);
    }

    /**
     * 新增电视剧剧集
     * 
     * @param appVideoDrama 电视剧剧集
     * @return 结果
     */
    @Override
    public int insertAppVideoDrama(AppVideoDrama appVideoDrama)
    {
        appVideoDrama.setCreateTime(DateUtils.getNowDate());
        return appVideoDramaMapper.insertAppVideoDrama(appVideoDrama);
    }

    /**
     * 修改电视剧剧集
     * 
     * @param appVideoDrama 电视剧剧集
     * @return 结果
     */
    @Override
    public int updateAppVideoDrama(AppVideoDrama appVideoDrama)
    {
        return appVideoDramaMapper.updateAppVideoDrama(appVideoDrama);
    }

    /**
     * 批量删除电视剧剧集
     * 
     * @param ids 需要删除的电视剧剧集ID
     * @return 结果
     */
    @Override
    public int deleteAppVideoDramaByIds(Long[] ids)
    {
        return appVideoDramaMapper.deleteAppVideoDramaByIds(ids);
    }

    /**
     * 删除电视剧剧集信息
     * 
     * @param id 电视剧剧集ID
     * @return 结果
     */
    @Override
    public int deleteAppVideoDramaById(Long id)
    {
        return appVideoDramaMapper.deleteAppVideoDramaById(id);
    }
}
